var ZWItems;

var vm = new Vue({
    el: "#app",
    data: function () {
        return {
            ShNo:"",
            //展位信息
            columns1: [
                {
                    type: 'index',
                    title: '序号',
                    width:45,
                    align: 'center',
                },
                {
                    title: '店面分类',
                    key: 'StoreType',
                    width:60,
                    align: 'center',
                },
                {
                    title: '店面',
                    key: 'Store',
                    width:60,
                    align: 'center',
                },
                {
                    title: '楼层',
                    key: 'Floor',
                    align: 'center',
                },
                {
                    title: '产品品类',
                    key: 'ProductType',
                    align: 'center',
                },
                {
                    title: '展位编号',
                    key: 'StandNo',
                    align: 'center',
                },
                {
                    title: '展位名称',
                    key: 'StandName',
                    align: 'center',
                },
                {
                    title: '展位状态',
                    key: 'Type',
                    align: 'center',
                },
                {
                    title: '展位面积',
                    key: 'StandArea',
                    align: 'center',
                },
                {
                    title: '代理品牌',
                    key: 'BrandName',
                    align: 'center',
                },
                {
                    title: '代理品牌系列',
                    key: 'SeriesName',
                    align: 'center',
                },
                {
                    title: '负责人',
                    key: 'ResponsibleMan',
                    align: 'center',
                },
                {
                    title: '负责人职务',
                    key: 'Position',
                    align: 'center',
                },
                {
                    title: '负责人手机号',
                    key: 'RPhoneNo',
                    align: 'center',
                },
                {
                    title: '撤场时间',
                    key: 'EndTime',
                    align: 'center',
                },
                {
                    title: '撤场原因',
                    key: 'EndReason',
                    align: 'center',
                },
                {
                    title: '入场时间',
                    key: 'RuTime',
                    align: 'center',
                },
                {
                    title: '招商人店面',
                    key: 'ZsStore',
                    align: 'center',
                },
                {
                    title: '招商人部门',
                    key: 'ZsBm',
                    align: 'center',
                },
                {
                    title: '招商人姓名',
                    key: 'ZsUserName',
                    align: 'center',
                },
                {
                    title: '操作',
                    key: 'action',
                    width:200,
                    align: 'center',
                    render: (h, params) => {
                        return h('div', [
                            h('Button', {
                                props: {
                                    type: 'ghost',
                                    size: 'small',
                                    icon:'trash-a',
                                },
                                attrs: {
                                    title: '删除'
                                },
                                style: {
                                    marginRight: '5px',
                                    border : '0',
                                    fontSize: '16px',
                                },
                                on: {
                                    click: () => {
                                        var self = this;
                                        self.IsOrNotDelete = true;
                                        // this.delZWInfo(params);
                                        self.ZwParam = params;

                                    }
                                }
                            }),
                            h('span', {

                            },'|'),
                            h('Button', {
                                props: {
                                    type: 'ghost',
                                    size: 'small',
                                    icon:'edit',
                                },
                                attrs: {
                                    title: '编辑'
                                },
                                style: {
                                    marginRight: '5px',
                                    border : '0',
                                    fontSize: '16px',
                                },
                                on: {
                                    click: () => {
                                        window.location.href="./zw_edit.html?ID="+params.row.ID;
                                    }
                                }
                            }),
                        ]);
                    }


                }
            ],
            //是否删除展位弹框
            IsOrNotDelete:false,
            ZwParam:'',
            // 接下来绑定数据，分别对应前面的列的key值来进行数据绑定
            data1: [],
            // 初始化信息总条数
            dataCount:0,
            StandAreaTotal:"",
            StartStandAreaTotal:"",
            EndStandAreaTotal:"",
            StartDMStandAreaTotal:"",
            StartOtherStandAreaTotal:"",
            //展位信息end
            formItem:{
                Store:"",
                Bm:"",
                ID:"",
                Name:"",
                Sex:"",
                Tel1:"",
                Tel2:"",
                Fixtel:"",
                Province:"",
                City:"",
                County:"",
                Jiguan:"",
                CardNo:"",
                DisCardNo:"",
                Birthday:"",
                YinOrYang:"",
                PastDaiBrand:"",
                ZsProgress:"",
                PastDaiBrand:"",
                StartTime:"",
                Relations:"",
                ShStar:"",
                ProductType:""
            },
            zwItem: ZWItems,
            stripe: true,
            StoreTypeList:[
                {
                    value: '东明店面',
                    label: '东明店面'
                },
                {
                    value: '红星美凯龙',
                    label: '红星美凯龙'
                },
                {
                    value: '居然之家',
                    label: '居然之家'
                },
                {
                    value: '怀特',
                    label: '怀特'
                },
                {
                    value: '米氏',
                    label: '米氏'
                },
                {
                    value: '蓝天',
                    label: '蓝天'
                },
                {
                    value: '明月',
                    label: '明月'
                },
                {
                    value: '正定金河',
                    label: '正定金河'
                },
                {
                    value: '正定三才',
                    label: '正定三才'
                },
            ],
            StoreList: [],
            ProductTypeList:[
                {
                    value: '软体家具',
                    label: '软体家具'
                },
                {
                    value: '板式板木家具',
                    label: '板式板木家具'
                },
                {
                    value: '实木家具',
                    label: '实木家具'
                },
                {
                    value: '欧式家具',
                    label: '欧式家具'
                },
                {
                    value: '红木家具',
                    label: '红木家具'
                },
                {
                    value: '儿童家具',
                    label: '儿童家具'
                },
                {
                    value: '定制家具',
                    label: '定制家具'
                },
                {
                    value: '小件、家纺',
                    label: '小件、家纺'
                },
                {
                    value: '办公家具',
                    label: '办公家具'
                },
                {
                    value: '建材、异业',
                    label: '建材、异业'
                },
                {
                    value: '智能家具',
                    label: '智能家具'
                },
                {
                    value: '户外家具',
                    label: '户外家具'
                },
                {
                    value: '电器',
                    label: '电器'
                },
                {
                    value: '装饰公司',
                    label: '装饰公司'
                },
                {
                    value: '酒店家具',
                    label: '酒店家具'
                },
                {
                    value: '藤器',
                    label: '藤器'
                },
            ],
            FloorList:[
                {
                    value: '一楼',
                    label: '一楼'
                },
                {
                    value: '二楼',
                    label: '二楼'
                },
                {
                    value: '三楼',
                    label: '三楼'
                },
                {
                    value: '四楼',
                    label: '四楼'
                },
                {
                    value: '五楼',
                    label: '五楼'
                },
                {
                    value: '六楼',
                    label: '六楼'
                },
                {
                    value: '负一楼',
                    label: '负一楼'
                },
                {
                    value: '负二楼',
                    label: '负二楼'
                },
            ],
            StandTypeList:[
                {
                    value: '正常',
                    label: '正常'
                },
                {
                    value: '撤场中',
                    label: '撤场中'
                },
                {
                    value: '已撤场',
                    label: '已撤场'
                },
            ],
            BrandList:[],
            SeriesList:[],
            formRight: {
                StoreType: '',
                Store: '',
                Floor: '',
                ProductType: '',
                StandNo: '',
                StandName: '',
                StandType: '',
                StandArea: '',
                RuTime:'',
                ZsStore:'',
                ZsBm:'',
                ZsName:'',
                ResponsibleMan:'',
                Position:'',
                RPhoneNo:'',
                EndTime:'',
                EndReason:'',
                BrandName:'',
                SeriesName:''
            },
            //添加品牌、系列start
            modal1: false,
            BrandForm:{
                BrandName:"",
                SeriesName:""
            },
            //添加品牌系列end
            //上传
            UploadBookList:[],
            LogoList:[],
            LicenseList:[],
            CardList:[],
            ZjReportList:[],
            ManageImgList:[],
            ProductPremiseList:[],
            UseExplainList:[],
            ProductPhotoList:[],
            HonorBookList:[],
            src:'',
            src1:'',
            src2:'',
            src3:'',
            src4:'',
            src5:'',
            src6:'',
            src7:'',
            src8:'',
            src9:'',
            file:[],
            file1:[],
            file2:[],
            file3:[],
            file4:[],
            file5:[],
            file6:[],
            file7:[],
            file8:[],
            file9:[],
            format:[],
            uploadFile:[],
            uploadFile1:[],
            uploadFile2:[],
            uploadFile3:[],
            uploadFile4:[],
            uploadFile5:[],
            uploadFile6:[],
            uploadFile7:[],
            uploadFile8:[],
            uploadFile9:[],
            loadingStatus:"",
            OtherInfo:"",
            BigUrl:"",
            //上传end
            isShow:false,//添加展位隐藏
            handleView1:false,//授权书、商标注册、产品使用说明书、产品管理图册图片放大弹框
            handleView2:false,//执照、税务登记证、组织机构代码证、生产许可证、荣誉证书图片放大弹框
            handleView3:false,//身份证图片放大弹框
            handleView4:false,//质检报告图片放大弹框
            handleView5:false,//管理图纸及相关说明图片放大弹框
            handleView6:false,
            handleView7:false,
            handleView8:false,
            handleView9:false,
            handleView10:false,
        }
    },
    created(){
        var ID = this.oneValues();
        this.ShNo = ID;
        this.initThisPage();
        this.queryzwtable();
        this.queryBrandList();
        this.queryImgList();
    },
    methods: {
        changeStore(){
            var self = this;
            self.formRight.Store = "";
            self.StoreList = new Array();
            if(self.formRight.StoreType=="东明店面"){
                self.StoreList = [{value: "东明东二环店", label: "东明东二环店"},{value: "东明建华店", label: "东明建华店"},{value: "东明金利来店", label: "东明金利来店"},{value: "东明北杜店", label: "东明北杜店"},{value: "东明西二环店", label: "东明西二环店"},{value: "东明北二环店", label: "东明北二环店"},{value: "东明蒂摩玛办公馆", label: "东明蒂摩玛办公馆"}];
            }else if(self.formRight.StoreType=="红星美凯龙"){
                self.StoreList = [{value: "红星方北店", label: "红星方北店"},{value: "红星和平店", label: "红星和平店"},{value: "红星中储店", label: "红星中储店"},{value: "红星西古城店", label: "红星西古城店"}];
            }else if(self.formRight.StoreType=="居然之家"){
                self.StoreList = [{value: "居然之家长安店", label: "居然之家长安店"}];
            }else if(self.formRight.StoreType=="怀特"){
                self.StoreList = [{value: "怀特家具城", label: "怀特家具城"},{value: "怀特红木楼", label: "怀特红木楼"},{value: "怀特建材城", label: "怀特建材城"},{value: "怀特陶瓷城", label: "怀特陶瓷城"}];
            }else if(self.formRight.StoreType=="米氏"){
                self.StoreList = [{value: "米氏中华店", label: "米氏中华店"}];
            }else if(self.formRight.StoreType=="蓝天"){
                self.StoreList = [{value: "蓝天圣木家具城", label: "蓝天圣木家具城"}];
            }else if(self.formRight.StoreType=="明月"){
                self.StoreList = [{value: "明月家具城", label: "明月家具城"},{value: "新明月北二环店", label: "新明月北二环店"},{value: "明月石铜路装饰材料市场", label: "明月石铜路装饰材料市场"},{value: "明月丰收路装饰材料市场", label: "明月丰收路装饰材料市场"}];
            }else if(self.formRight.StoreType=="正定金河"){
                self.StoreList = [{value: "金河家具城", label: "金河家具城"}];
            }else if(self.formRight.StoreType=="正定三才"){
                self.StoreList = [{value: "三才家具城", label: "三才家具城"}];
            }
        },
        initThisPage() {
            var self = this;
            var ShNo = self.ShNo;
            var jsondata = {"ID":ShNo};
            var data_json = JSON.stringify(jsondata)
            $.ajax({
                url: "./goSHGL/initLookInfo", //请求的url地址
                dataType: "json", //返回格式为json
                async:false,
                data: data_json, //参数值
                type: "POST", //请求方式
                processData: false, //对表单data数据是否进行序列化
                contentType: false, //dataType设置你收到服务器数据的格式
                headers: {
                    'Content-Type': 'application/json'
                },
                success: function(data) {
                    var formcontent = JSON.parse(data.data);
                    self.formItem.Store = formcontent.Store;
                    self.formItem.Bm = formcontent.Bm;
                    self.formItem.ID = formcontent.ID;
                    self.formItem.Name = formcontent.Name;
                    self.formItem.Sex = formcontent.Sex;
                    self.formItem.Tel1 = formcontent.Tel1;
                    self.formItem.Tel2 = formcontent.Tel2;
                    self.formItem.Fixtel = formcontent.Fixtel;
                    self.formItem.Province = formcontent.Province;
                    self.formItem.City = formcontent.City;
                    self.formItem.County = formcontent.County;
                    self.formItem.Jiguan = formcontent.Jiguan;
                    var CardNo = formcontent.CardNo;
                    self.formItem.CardNo = CardNo;
                    CardNo = CardNo.substring(0,3)+"***********"+CardNo.substring(14);
                    self.formItem.DisCardNo = CardNo;
                    self.formItem.Birthday = formcontent.Birthday;
                    self.formItem.YinOrYang = formcontent.YinOrYang;
                    self.formItem.PastDaiBrand = formcontent.PastDaiBrand;
                    self.formItem.ZsProgress = formcontent.ZsProgress;
                    self.formItem.PastDaiBrand = formcontent.PastDaiBrand;
                    self.formItem.StartTime = formcontent.StartTime;
                    self.formItem.Relations = formcontent.Relations;
                    self.formItem.ShStar = formcontent.ShStar;
                    self.formItem.ProductType = formcontent.ProductType;

                },
                error: function() {
                },
            });
        },
        queryBrandList(){
            var self = this;
            self.BrandList = [];
            self.formRight.BrandName = "";
            var ShNo = self.ShNo;
            var jsondata={"ShNo":ShNo};
            var data_json = JSON.stringify(jsondata);
            $.ajax({
                url: "./goSHGL/queryBrandList", //请求的url地址
                dataType: "json", //返回格式为json
                async:false,
                data: data_json, //参数值
                type: "POST", //请求方式
                processData: false, //对表单data数据是否进行序列化
                contentType: false, //dataType设置你收到服务器数据的格式
                headers: {
                    'Content-Type': 'application/json'
                },
                success: function(data) {
                    var tempArr = new Array();
                    tempArr = data.BrandList;
                    for(var i=0;i<tempArr.length;i++){
                        var temp = {
                            label:tempArr[i].BrandName,
                            value:tempArr[i].BrandName
                        }
                        self.BrandList.push(temp);
                    }
                },
                error: function() {},
            });
        },
        queryImgList(){
            var self = this;
            self.UploadBookList = [];
            self.LogoList = [];
            self.LicenseList = [];
            self.CardList = [];
            self.ZjReportList = [];
            self.ManageImgList = [];
            self.ProductPremiseList=[];
            self.UseExplainList=[];
            self.ProductPhotoList=[];
            self.HonorBookList=[];
            var ShNo = self.ShNo;
            var jsondata={"ShNo":ShNo};
            var data_json = JSON.stringify(jsondata);
            $.ajax({
                url: "./goSHGL/queryImgList", //请求的url地址
                dataType: "json", //返回格式为json
                async:false,
                data: data_json, //参数值
                type: "POST", //请求方式
                processData: false, //对表单data数据是否进行序列化
                contentType: false, //dataType设置你收到服务器数据的格式
                headers: {
                    'Content-Type': 'application/json'
                },
                success: function(data) {
                    self.UploadBookList = eval(data.data1);
                    self.LicenseList = eval(data.data2);
                    self.CardList = eval(data.data3);
                    self.ZjReportList = eval(data.data4);
                    self.ManageImgList = eval(data.data5);
                    self.LogoList = eval(data.data6);
                    self.ProductPremiseList = eval(data.data7);
                    self.UseExplainList = eval(data.data8);
                    self.ProductPhotoList = eval(data.data9);
                    self.HonorBookList = eval(data.data10);
                },
                error: function() {},
            });
        },
        changeSeries(){
            var self = this;
            self.SeriesList = [];
            self.formRight.SeriesName = "";
            var BrandName = self.formRight.BrandName;
            var jsondata={ "BrandName":BrandName};
            var data_json = JSON.stringify(jsondata);
            $.ajax({
                url: "./goSHGL/querySeriesByBrandName", //请求的url地址
                dataType: "json", //返回格式为json
                async:false,
                data: data_json, //参数值
                type: "POST", //请求方式
                processData: false, //对表单data数据是否进行序列化
                contentType: false, //dataType设置你收到服务器数据的格式
                headers: {
                    'Content-Type': 'application/json'
                },
                success: function(data) {
                    var tempArr = new Array();
                    tempArr = data.SeriesList;
                    for(var i=0;i<tempArr.length;i++){
                        var temp = {
                            label:tempArr[i].SeriesName,
                            value:tempArr[i].BrandID
                        }
                        self.SeriesList.push(temp);
                    }
                },
                error: function() {},
            });
        },
        //查看身份证号
        queryCardNo(){

        },
        closable (cardno) {
            this.$Message.info({
                content: cardno,
                duration: 10,
                closable: true
            });
        },
        queryzwtable(pageNum,pageSize){
            var self = this;
            var info ;
            var total;
            var StandAreaTotal;
            var StartStandAreaTotal;
            var EndStandAreaTotal;
            var StartDMStandAreaTotal;
            var StartOtherStandAreaTotal;
            var ShNo = this.ShNo;
            var jsondata={ "ShNo":ShNo};
            var data_json = JSON.stringify(jsondata);
            $.ajax({
                url: "./goSHGL/queryAllZWInfos", //请求的url地址
                dataType: "json", //返回格式为json
                async:false,
                data: data_json, //参数值
                type: "POST", //请求方式
                processData: false, //对表单data数据是否进行序列化
                contentType: false, //dataType设置你收到服务器数据的格式
                headers: {
                    'Content-Type': 'application/json'
                },
                success: function(data) {
                    info = eval(data.data);
                    total = data.totalnum;
                    StandAreaTotal = data.StandAreaTotal;
                    StartStandAreaTotal = data.StartStandAreaTotal;
                    EndStandAreaTotal = data.EndStandAreaTotal;
                    StartDMStandAreaTotal = data.StartDMStandAreaTotal;
                    StartOtherStandAreaTotal = data.StartOtherStandAreaTotal;

                },
                error: function() {},
            });
            if(info){
                self.data1 = info;
                self.dataCount = total;
                self.StandAreaTotal = StandAreaTotal;
                self.StartStandAreaTotal = StartStandAreaTotal;
                self.EndStandAreaTotal = EndStandAreaTotal;
                self.StartDMStandAreaTotal = StartDMStandAreaTotal;
                self.StartOtherStandAreaTotal = StartOtherStandAreaTotal;
            }
        },
        //添加展位信息显示隐藏
        showToggle(){
            this.isShow = !this.isShow;
        },
        //添加品牌名称与系列名称
        saveBrandAndSeries(){
            var self = this;
            var BrandName = self.BrandForm.BrandName;
            var SeriesName = self.BrandForm.SeriesName;
            if(BrandName==null||BrandName.trim()==""){
                toastr.warning("请输入品牌名称");
            }
            if(SeriesName==null||SeriesName.trim()==""){
                toastr.warning("请输入系列名称");
            }
            var jsondata={ "BrandName":BrandName,"SeriesName":SeriesName};
            var data_json = JSON.stringify(jsondata);
            $.ajax({
                url: "./goSHGL/saveBrandAndSeries", //请求的url地址
                dataType: "json", //返回格式为json
                async:false,
                data: data_json, //参数值
                type: "POST", //请求方式
                processData: false, //对表单data数据是否进行序列化
                contentType: false, //dataType设置你收到服务器数据的格式
                headers: {
                    'Content-Type': 'application/json'
                },
                success: function(data) {
                    if(data.status == "2"){
                        toastr.warning("保存失败，已有该品牌系列");
                    }
                    if(data.status == "1"){
                        toastr.success("保存成功");
                        self.modal1 = false;
                        self.queryBrandList();
                    }
                    if(data.status == "0"){
                        toastr.warning("保存失败");
                    }
                    self.BrandForm.BrandName = "";
                    self.BrandForm.SeriesName = "";
                    return false;
                },
                error: function() {},
            });
        },
        //添加展位信息
        saveZWInfos(){
            var self = this;
            var ShNo = self.ShNo;
            if(ShNo==null||ShNo==''){
                toastr.warning("商户编号未获取请重新刷新界面")
                return false;
            }
            if(self.formRight.StoreType==null||self.formRight.StoreType==""){
                toastr.warning("请选择店面分类");
                return false;
            }
            if(self.formRight.Store==null||self.formRight.Store==""){
                toastr.warning("请选择中心店面");
                return false;
            }
            if(self.formRight.Floor==null||self.formRight.Floor==""){
                toastr.warning("请选择楼层");
                return false;
            }
            if(self.formRight.ProductType==null||self.formRight.ProductType==""){
                toastr.warning("请选择产品品类");
                return false;
            }
            /*if(self.formRight.StandNo==null||self.formRight.StandNo.trim()==""){
                toastr.warning("请录入展位编号");
                return false;
            }*/
            if(self.formRight.StandName==null||self.formRight.StandName.trim()==""){
                toastr.warning("请录入展位名称");
                return false;
            }
            if(self.formRight.StandType==null||self.formRight.StandType==""){
                toastr.warning("请选择展位状态");
                return false;
            }
            if(self.formRight.StandArea==null||self.formRight.StandArea==""){
                toastr.warning("请录入展位面积");
                return false;
            }
            if(self.isMianJi(self.formRight.StandArea)){

            }else{
                toastr.warning("展位面积请填写两位小数以内的正数");
                return false;
            }
            if(self.formRight.RuTime!=null&&self.formRight.RuTime!=""){
                var tempzwrutime = new Date(self.formRight.RuTime);
                self.formRight.RuTime = tempzwrutime.toLocaleDateString();
            }else{
                self.formRight.RuTime = null;
            }

            if(self.formRight.BrandName==null||self.formRight.BrandName==""){
                toastr.warning("请选择品牌名称");
                return false;
            }
            if(self.formRight.SeriesName==null||self.formRight.SeriesName==""){
                toastr.warning("请选择系列名称");
                return false;
            }

            if(self.formRight.RPhoneNo!=null&&self.formRight.RPhoneNo!=""){
                if(!self.isPoneAvailable(self.formRight.RPhoneNo)){
                    toastr.warning("请录入正确的负责人手机号");
                    return false;
                }

            }

            if(self.formRight.EndTime!=null&&self.formRight.EndTime!=""){
                var tempzwEndtime = new Date(self.formRight.EndTime);
                self.formRight.EndTime = tempzwEndtime.toLocaleDateString();
            }
            var zwInfos = self.formRight;
            zwInfos.ShNo = ShNo;
            var data_json = JSON.stringify(zwInfos);
            $.ajax({
                url: "./goSHGL/saveZWInfo", //请求的url地址
                dataType: "json", //返回格式为json
                async:false,
                data: data_json, //参数值
                type: "POST", //请求方式
                processData: false, //对表单data数据是否进行序列化
                contentType: false, //dataType设置你收到服务器数据的格式
                headers: {
                    'Content-Type': 'application/json'
                },
                success: function(data) {
                    if(data.status == "1"){
                        toastr.success("保存成功");
                        self.queryzwtable();
                        self.formRight.StoreType = "";
                        self.formRight.Store = "";
                        self.formRight.Floor = "";
                        self.formRight.ProductType = "";
                        self.formRight.StandNo = "";
                        self.formRight.StandName = "";
                        self.formRight.StandType = "";
                        self.formRight.StandArea = "";
                        self.formRight.RuTime = "";
                        self.formRight.ZsStore = "";
                        self.formRight.ZsBm = "";
                        self.formRight.ZsName = "";
                        self.formRight.ResponsibleMan = "";
                        self.formRight.Position = "";
                        self.formRight.RPhoneNo = "";
                        self.formRight.EndTime = "";
                        self.formRight.EndReason = "";
                        self.formRight.BrandName = "";
                        self.formRight.SeriesName = "";
                    }
                    if(data.status == "0"){
                        toastr.warning("保存失败");
                    }
                    return false;
                },
                error: function() {},
            });
        },
        oneValues(){
            var result;
            var url=window.location.search; //获取url中"?"符后的字串
            if(url.indexOf("?")!=-1){
                result = url.substr(url.indexOf("=")+1);
            }
            return result;
        },
        isMianJi(mj){
            var reg = /^[1-9]+\d*(\.\d{0,2})?$|^0?\.\d{0,2}$/;
            if(reg.test(mj)){
                return true;
            }else{
                return false;
            }
        },
        //手机号验证
        isPoneAvailable(str) {
            var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
            if (!myreg.test(str)) {
                return false;
            } else {
                return true;
            }
        },
        ok () {
        },
        cancel () {
        },
        goBack(){
            window.location.href = "./sh_search.html"
        },
        editZWInfo(EndTime,EndReason,StandNo){
            if(EndTime==''||EndTime==null){
                toastr.warning("展位撤场日期不得为空");
                return false;
            }
            var tempEndTime = new Date(EndTime);
            EndTime = tempEndTime.toLocaleDateString();
            if(EndReason==''||EndReason==null){
                toastr.warning("展位撤场原因不得为空");
                return false;
            }
            var jsondata = {"EndTime":EndTime,"EndReason":EndReason,"StandNo":StandNo};
            var data_json = JSON.stringify(jsondata);
            $.ajax({
                url: "./goSHGL/editZWInfo", //请求的url地址
                dataType: "json", //返回格式为json
                async:false,
                data: data_json, //参数值
                type: "POST", //请求方式
                processData: false, //对表单data数据是否进行序列化
                contentType: false, //dataType设置你收到服务器数据的格式
                headers: {
                    'Content-Type': 'application/json'
                },
                success: function(data) {
                    toastr.success("编辑成功")
                },
                error: function() {},
            });
        },
        delZWInfo(){
            var self = this;
            var params = self.ZwParam;
            var ID = params.row.ID;
            var jsondata = {"ID":ID}
            var data_json = JSON.stringify(jsondata);
            $.ajax({
                url: "./goSHGL/delZWInfo", //请求的url地址
                dataType: "json", //返回格式为json
                async:false,
                data: data_json, //参数值
                type: "POST", //请求方式
                processData: false, //对表单data数据是否进行序列化
                contentType: false, //dataType设置你收到服务器数据的格式
                headers: {
                    'Content-Type': 'application/json'
                },
                success: function(data) {
                    if(data.status=="1"){
                        toastr.success("删除成功");
                        self.initThisPage();
                        self.queryzwtable();
                        self.queryBrandList();
                    }
                },
                error: function() {},
            });
        },
        /*上传查看资料 开始*/
        // 上传授权书前的事件钩子
        handleMaxSize(file){
            toastr.warning("超出文件大小限制,文件 "+ file.name +" 太大，不能超过 2M。");
            return false;
        },
        handleUpload (file) {
            var self = this;
            var ID = this.SHID;
            // 选择文件后 这里判断文件类型 保存文件 自定义一个keyid 值 方便后面删除操作
            if(this.file.length>=1){
                this.$Notice.warning({
                    title: '警告',
                    desc: '只允许上传一张图片'
                });
                return false;
            }
            // 保存文件到总展示文件数据里
            this.file.push(file);
            // 保存文件到需要上传的文件数组里
            this.uploadFile.push(file)
            //预览
            var reader = new FileReader();
            reader.readAsDataURL(file);
            this.format=['jpg','jpeg','png'];
            setTimeout(() => {
                if (!self.src){
                    self.src=reader.result;
                }
            }, 200);
            // 返回 falsa 停止自动上传 我们需要手动上传
            return false;
        },
        //上传执照
        handleUpload1 (file1) {
            var self = this;
            var ID = this.SHID;
            // 选择文件后 这里判断文件类型 保存文件 自定义一个keyid 值 方便后面删除操作
            if(this.file1.length>=1){
                this.$Notice.warning({
                    title: '警告',
                    desc: '只允许上传一张图片'
                });
                return false;
            }
            // 保存文件到总展示文件数据里
            this.file1.push(file1);
            // 保存文件到需要上传的文件数组里
            this.uploadFile1.push(file1)
            //预览
            var reader = new FileReader();
            reader.readAsDataURL(file1);
            this.format=['jpg','jpeg','png'];
            // reader.onload = function () {
            //     self.src1 = reader.result;
            // }
            setTimeout(() => {
                if (!self.src1){
                    self.src1=reader.result;
                }
            }, 200);
            // 返回 falsa 停止自动上传 我们需要手动上传
            return false;
        },
        //上传身份证
        handleUpload2 (file2) {
            var self = this;
            var ID = this.SHID;
            // 选择文件后 这里判断文件类型 保存文件 自定义一个keyid 值 方便后面删除操作
            if(this.file2.length>=1){
                this.$Notice.warning({
                    title: '警告',
                    desc: '只允许上传一张图片'
                });
                return false;
            }
            // 保存文件到总展示文件数据里
            this.file2.push(file2);
            // 保存文件到需要上传的文件数组里
            this.uploadFile2.push(file2)
            //预览
            var reader = new FileReader();
            reader.readAsDataURL(file2);
            this.format=['jpg','jpeg','png'];
            // reader.onload = function () {
            //     self.src2 = reader.result;
            // }
            setTimeout(() => {
                if (!self.src2){
                    self.src2=reader.result;
                }
            }, 200);
            // 返回 falsa 停止自动上传 我们需要手动上传
            return false;
        },
        //上传质检报告
        handleUpload3 (file3) {
            var self = this;
            var ID = this.SHID;
            // 选择文件后 这里判断文件类型 保存文件 自定义一个keyid 值 方便后面删除操作
            if(this.file3.length>=1){
                this.$Notice.warning({
                    title: '警告',
                    desc: '只允许上传一张图片'
                });
                return false;
            }
            // 保存文件到总展示文件数据里
            this.file3.push(file3);
            // 保存文件到需要上传的文件数组里
            this.uploadFile3.push(file3)
            //预览
            var reader = new FileReader();
            reader.readAsDataURL(file3);
            this.format=['jpg','jpeg','png'];
            // reader.onload = function () {
            //     self.src2 = reader.result;
            // }
            setTimeout(() => {
                if (!self.src3){
                    self.src3=reader.result;
                }
            }, 200);
            // 返回 falsa 停止自动上传 我们需要手动上传
            return false;
        },
        //上传管理图纸及相关说明
        handleUpload4 (file4) {
            var self = this;
            var ID = this.SHID;
            // 选择文件后 这里判断文件类型 保存文件 自定义一个keyid 值 方便后面删除操作
            if(this.file4.length>=1){
                this.$Notice.warning({
                    title: '警告',
                    desc: '只允许上传一张图片'
                });
                return false;
            }
            // 保存文件到总展示文件数据里
            this.file4.push(file4);
            // 保存文件到需要上传的文件数组里
            this.uploadFile4.push(file4)
            //预览
            var reader = new FileReader();
            reader.readAsDataURL(file4);
            this.format=['jpg','jpeg','png'];
            // reader.onload = function () {
            //     self.src2 = reader.result;
            // }
            setTimeout(() => {
                if (!self.src4){
                    self.src4=reader.result;
                }
            }, 200);
            // 返回 falsa 停止自动上传 我们需要手动上传
            return false;
        },
        //上传商标注册
        handleUpload5 (file5) {
            var self = this;
            var ID = this.SHID;
            // 选择文件后 这里判断文件类型 保存文件 自定义一个keyid 值 方便后面删除操作
            if(this.file5.length>=1){
                this.$Notice.warning({
                    title: '警告',
                    desc: '只允许上传一张图片'
                });
                return false;
            }
            // 保存文件到总展示文件数据里
            this.file5.push(file5);
            // 保存文件到需要上传的文件数组里
            this.uploadFile5.push(file5)
            //预览
            var reader = new FileReader();
            reader.readAsDataURL(file5);
            this.format=['jpg','jpeg','png'];
            // reader.onload = function () {
            //     self.src2 = reader.result;
            // }
            setTimeout(() => {
                if (!self.src5){
                    self.src5=reader.result;
                }
            }, 200);
            // 返回 falsa 停止自动上传 我们需要手动上传
            return false;
        },
        //上传生产许可证
        handleUpload6 (file6) {
            var self = this;
            var ID = this.SHID;
            // 选择文件后 这里判断文件类型 保存文件 自定义一个keyid 值 方便后面删除操作
            if(this.file6.length>=1){
                this.$Notice.warning({
                    title: '警告',
                    desc: '只允许上传一张图片'
                });
                return false;
            }
            // 保存文件到总展示文件数据里
            this.file6.push(file6);
            // 保存文件到需要上传的文件数组里
            this.uploadFile6.push(file6)
            //预览
            var reader = new FileReader();
            reader.readAsDataURL(file6);
            this.format=['jpg','jpeg','png'];
            // reader.onload = function () {
            //     self.src2 = reader.result;
            // }
            setTimeout(() => {
                if (!self.src6){
                    self.src6=reader.result;
                }
            }, 200);
            // 返回 falsa 停止自动上传 我们需要手动上传
            return false;
        },
        //上传产品使用说明书
        handleUpload7 (file7) {
            var self = this;
            var ID = this.SHID;
            // 选择文件后 这里判断文件类型 保存文件 自定义一个keyid 值 方便后面删除操作
            if(this.file7.length>=1){
                this.$Notice.warning({
                    title: '警告',
                    desc: '只允许上传一张图片'
                });
                return false;
            }
            // 保存文件到总展示文件数据里
            this.file7.push(file7);
            // 保存文件到需要上传的文件数组里
            this.uploadFile7.push(file7)
            //预览
            var reader = new FileReader();
            reader.readAsDataURL(file7);
            this.format=['jpg','jpeg','png'];
            setTimeout(() => {
                if (!self.src7){
                    self.src7=reader.result;
                }
            }, 200);
            // 返回 falsa 停止自动上传 我们需要手动上传
            return false;
        },
        //上传产品图册
        handleUpload8 (file8) {
            var self = this;
            var ID = this.SHID;
            // 选择文件后 这里判断文件类型 保存文件 自定义一个keyid 值 方便后面删除操作
            if(this.file8.length>=1){
                this.$Notice.warning({
                    title: '警告',
                    desc: '只允许上传一张图片'
                });
                return false;
            }
            // 保存文件到总展示文件数据里
            this.file8.push(file8);
            // 保存文件到需要上传的文件数组里
            this.uploadFile8.push(file8)
            //预览
            var reader = new FileReader();
            reader.readAsDataURL(file8);
            this.format=['jpg','jpeg','png'];
            setTimeout(() => {
                if (!self.src8){
                    self.src8=reader.result;
                }
            }, 200);
            // 返回 falsa 停止自动上传 我们需要手动上传
            return false;
        },
        //上传相关荣誉证书
        handleUpload9 (file9) {
            var self = this;
            var ID = this.SHID;
            // 选择文件后 这里判断文件类型 保存文件 自定义一个keyid 值 方便后面删除操作
            if(this.file9.length>=1){
                this.$Notice.warning({
                    title: '警告',
                    desc: '只允许上传一张图片'
                });
                return false;
            }
            // 保存文件到总展示文件数据里
            this.file9.push(file9);
            // 保存文件到需要上传的文件数组里
            this.uploadFile9.push(file9)
            //预览
            var reader = new FileReader();
            reader.readAsDataURL(file9);
            this.format=['jpg','jpeg','png'];
            setTimeout(() => {
                if (!self.src9){
                    self.src9=reader.result;
                }
            }, 200);
            // 返回 falsa 停止自动上传 我们需要手动上传
            return false;
        },
        delectFile (keyID) { // 删除文件
            // 删除总展示文件里的当前文件
            this.file.splice(0);
            // 删除需要上传文件数据里的当前文件
            this.uploadFile.splice(0);
            this.src=null;
        },
        delectFile1 (keyID) { // 删除文件
            // 删除总展示文件里的当前文件
            this.file1.splice(0);
            // 删除需要上传文件数据里的当前文件
            this.uploadFile1.splice(0);
            this.src1=null;
        },
        delectFile2 (keyID) { // 删除文件
            // 删除总展示文件里的当前文件
            this.file2.splice(0);
            // 删除需要上传文件数据里的当前文件
            this.uploadFile2.splice(0);
            this.src2=null;
        },
        delectFile3 (keyID) { // 删除文件
            // 删除总展示文件里的当前文件
            this.file3.splice(0);
            // 删除需要上传文件数据里的当前文件
            this.uploadFile3.splice(0);
            this.src3=null;
        },
        delectFile4 (keyID) { // 删除文件
            // 删除总展示文件里的当前文件
            this.file4.splice(0);
            // 删除需要上传文件数据里的当前文件
            this.uploadFile4.splice(0);
            this.src4=null;
        },
        delectFile5 (keyID) {
            this.file5.splice(0);
            // 删除需要上传文件数据里的当前文件
            this.uploadFile5.splice(0);
            this.src5=null;
        },
        delectFile6 (keyID) {
            this.file6.splice(0);
            // 删除需要上传文件数据里的当前文件
            this.uploadFile6.splice(0);
            this.src6=null;
        },
        delectFile7 (keyID) {
            this.file7.splice(0);
            // 删除需要上传文件数据里的当前文件
            this.uploadFile7.splice(0);
            this.src7=null;
        },
        delectFile8 (keyID) {
            this.file8.splice(0);
            // 删除需要上传文件数据里的当前文件
            this.uploadFile8.splice(0);
            this.src8=null;
        },
        delectFile9 (keyID) {
            this.file9.splice(0);
            // 删除需要上传文件数据里的当前文件
            this.uploadFile9.splice(0);
            this.src9=null;
        },
        upload () { // 上传文件
            for (let i = 0; i < this.uploadFile.length; i++) {
                let item = this.file[i];
                this.$refs.upload.post(item);
            }
        },
        upload1 () { // 上传文件
            for (let i = 0; i < this.uploadFile1.length; i++) {
                let item = this.file1[i];
                this.$refs.upload1.post(item);
            }
        },
        upload2 () { // 上传文件
            for (let i = 0; i < this.uploadFile2.length; i++) {
                let item = this.file2[i]
                this.$refs.upload2.post(item);
            }
        },
        upload3 () { // 上传文件
            for (let i = 0; i < this.uploadFile3.length; i++) {
                let item = this.file3[i]
                this.$refs.upload3.post(item);
            }
        },
        upload4 () { // 上传文件
            for (let i = 0; i < this.uploadFile4.length; i++) {
                let item = this.file4[i]
                this.$refs.upload4.post(item);
            }
        },
        upload5 () { // 上传文件
            for (let i = 0; i < this.uploadFile5.length; i++) {
                let item = this.file5[i]
                this.$refs.upload5.post(item);
            }
        },
        upload6 () { // 上传文件
            for (let i = 0; i < this.uploadFile6.length; i++) {
                let item = this.file6[i]
                this.$refs.upload6.post(item);
            }
        },
        upload7 () { // 上传文件
            for (let i = 0; i < this.uploadFile7.length; i++) {
                let item = this.file7[i]
                this.$refs.upload7.post(item);
            }
        },
        upload8 () { // 上传文件
            for (let i = 0; i < this.uploadFile8.length; i++) {
                let item = this.file8[i]
                this.$refs.upload8.post(item);
            }
        },
        upload9 () { // 上传文件
            for (let i = 0; i < this.uploadFile9.length; i++) {
                let item = this.file9[i]
                this.$refs.upload9.post(item);
            }
        },
        uploadSuccess(){
            this.src = "";
            this.file = [];
            this.uploadFile = [];
            this.queryImgList();
            toastr.success("上传授权书成功")
        },
        uploadSuccess1(){
            this.src1 = "";
            this.file1 = [];
            this.uploadFile1 = [];
            this.queryImgList();
            toastr.success("上传执照成功")
        },
        uploadSuccess2(){
            this.src2 = "";
            this.file2 = [];
            this.uploadFile2 = [];
            this.queryImgList();
            toastr.success("上传身份证成功")
        },
        uploadSuccess3(){
            this.src3 = "";
            this.file3 = [];
            this.uploadFile3 = [];
            this.queryImgList();
            toastr.success("上传质检报告成功")
        },
        uploadSuccess4(){
            this.src4 = "";
            this.file4 = [];
            this.uploadFile4 = [];
            this.queryImgList();
            toastr.success("上传管理图纸及相关说明成功")
        },
        uploadSuccess5(){
            this.src5 = "";
            this.file5 = [];
            this.uploadFile5 = [];
            this.queryImgList();
            toastr.success("上传商标注册成功")
        },
        uploadSuccess6(){
            this.src6 = "";
            this.file6 = [];
            this.uploadFile6 = [];
            this.queryImgList();
            toastr.success("上传生产许可证成功")
        },
        uploadSuccess7(){
            this.src7 = "";
            this.file7 = [];
            this.uploadFile7 = [];
            this.queryImgList();
            toastr.success("上传产品使用说明书成功")
        },
        uploadSuccess8(){
            this.src8 = "";
            this.file8 = [];
            this.uploadFile8 = [];
            this.queryImgList();
            toastr.success("上传产品图册成功")
        },
        uploadSuccess9(){
            this.src9 = "";
            this.file9 = [];
            this.uploadFile9 = [];
            this.queryImgList();
            toastr.success("上传相关荣誉证书成功")
        },
        /*上传查看资料结束*/
        /*删除图片*/
        delimg(ID,ShNo,Name,Type){
            var self = this;
            var jsondata={"ID":ID,"ShNo":ShNo,"Name":Name,"Type":Type};
            var data_json = JSON.stringify(jsondata);
            $.ajax({
                url: "./goSHGL/delSHImage", //请求的url地址
                dataType: "json", //返回格式为json
                async:false,
                data: data_json, //参数值
                type: "POST", //请求方式
                processData: false, //对表单data数据是否进行序列化
                contentType: false, //dataType设置你收到服务器数据的格式
                headers: {
                    'Content-Type': 'application/json'
                },
                success: function(data) {
                    if(data.status=="1"){
                        toastr.success("删除成功");
                        self.queryImgList();
                    }
                },
                error: function() {},
            });
        },
        saveOtherInfo(){
            var self = this;
            var OtherInfo = self.OtherInfo;
            var ID = self.ManageImgList[0].ShNo;
            var jsondata={"ID":ID,"OtherInfo":OtherInfo};
            var data_json = JSON.stringify(jsondata);
            $.ajax({
                url: "./goSHGL/saveOtherInfo", //请求的url地址
                dataType: "json", //返回格式为json
                async:false,
                data: data_json, //参数值
                type: "POST", //请求方式
                processData: false, //对表单data数据是否进行序列化
                contentType: false, //dataType设置你收到服务器数据的格式
                headers: {
                    'Content-Type': 'application/json'
                },
                success: function(data) {
                    if(data.status == "1"){
                        toastr.success("编辑成功");
                        self.queryImgList();
                    }
                    if(data.status == "0"){
                        toastr.warning("编辑失败");
                    }
                    return false;
                },
                error: function() {},
            });
        },
        openBookBig(BigUrl){
            var self = this;
            self.handleView1 = true
            self.BigUrl = BigUrl;
        }
    }
})
